package com.tjw.ec.upms.api.feign.factory;

import com.tjw.ec.upms.api.feign.RemoteUserPermitService;
import com.tjw.ec.upms.api.feign.fallback.RemoteUserPermitServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


/**
 * 远程调用异常工厂 : 用户授权表
 *
 * @author T-junwen
 * @email t-junwen@foxmail.com
 * @date 2019-08-02 11:58:44
 */
@Slf4j
@Component
public class RemoteUserPermitServiceFallbackFactory implements FallbackFactory<RemoteUserPermitService> {

    @Override
    public RemoteUserPermitService create(Throwable throwable) {
        RemoteUserPermitServiceFallbackImpl remoteUserPermitServiceFallback = new RemoteUserPermitServiceFallbackImpl();
        remoteUserPermitServiceFallback.setCause(throwable);
        return remoteUserPermitServiceFallback;
    }
}

